package mo.leetcode_top;

public class LO10_1 {

    public int fib(int n) {
        if (n < 2) {
            return n;
        }
        int f0 = 0;
        int f1 = 1;
        for (int i = 2; i <= n; i++) {
            int sum = (f0 + f1) % 1000000007;
            f0 = f1;
            f1 = sum;
        }
        return f1;
    }

}
